//
//  AppDelegate.swift
//  WeiBoDemo
//
//  Created by 万佳阳 on 16/8/1.
//  Copyright © 2016年 JYWan. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?
    // MARK:- 计算属性
    private var defaultVc : UIViewController? {
        let isLogin = JYUserAccountViewModel.shareInstance.isLogin
        return isLogin ? JYWelcomeViewController() : UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()
    }


    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        
        //设置全局颜色
        UITabBar.appearance().tintColor = UIColor.orangeColor()
        UINavigationBar.appearance().tintColor = UIColor.orangeColor()
        
        //创建window
        window = UIWindow(frame: UIScreen.mainScreen().bounds)
        window?.rootViewController = defaultVc
        window?.makeKeyAndVisible()
        
        return true
    }

}

// MARK:- 自定义Log
func JYLog<T>(message : T, file : String = #file, funcName : String = #function, lineNum : Int = #line) {
    
    #if DEBUG
    
        let fileName = (file as NSString).lastPathComponent
        print("\(fileName)-(\(lineNum)): \(message)")
        
    #endif
}


